const express = require('express');
const path = require('path');

const app = express();
const PORT = process.env.PORT || 3000;

// 静态文件服务
app.use(express.static(path.join(__dirname, 'public')));

// JSON解析
app.use(express.json());

// 基本API路由示例
app.get('/api/status', (req, res) => {
  res.json({
    success: true,
    message: 'Server is running',
    timestamp: new Date().toISOString()
  });
});

// 这里可以添加更多API路由
// app.post('/api/your-endpoint', (req, res) => { /* 处理逻辑 */ });

// 启动服务器
app.listen(PORT, () => {
  console.log(`Server is running on port ${PORT}`);
});